﻿namespace Cos.Module.Membership.NHibernate.Tests
{
    using System;

    using Cos.Core.NHibernate;
    using Cos.Core.NHibernate.Tests;

    using NUnit.Framework;

    [TestFixture]
    public class UserDataModelFixture : ModuleFixtureBase
    {
        [Test]
        public void CanMapUserDataModel()
        {
            new PersistenceSpecification<UserDataModel>(Session)
                .CheckProperty(x => x.ApplicationName, ApplicationName)
                .CheckProperty(x => x.Comment, "some comments")
                .CheckProperty(x => x.CreationDate, new DateTime(2011, 01, 06))
                .CheckProperty(x => x.Email, "email@email.com")
                .CheckProperty(x => x.FailedPasswordAnswerAttemptCount, 2)
                .CheckProperty(x => x.FailedPasswordAnswerAttemptWindowStart, new DateTime(2011, 01, 06))
                .CheckProperty(x => x.FailedPasswordAttemptCount, 2)
                .CheckProperty(x => x.FailedPasswordAttemptWindowStart, new DateTime(2011, 01, 06))
                .CheckProperty(x => x.IsApproved, true)
                .CheckProperty(x => x.IsLockedOut, false)
                .CheckProperty(x => x.IsOnline, false)
                .CheckProperty(x => x.LastActivityDate, new DateTime(2011, 01, 06))
                .CheckProperty(x => x.LastLockedOutDate, new DateTime(2011, 01, 06))
                .CheckProperty(x => x.LastLoginDate, new DateTime(2011, 01, 06))
                .CheckProperty(x => x.LastPasswordChangeDate, new DateTime(2011, 01, 06))
                .CheckProperty(x => x.PKID, Guid.NewGuid())
                .CheckProperty(x => x.Password, "password")
                .CheckProperty(x => x.PasswordAnswer, "password answer")
                .CheckProperty(x => x.PasswordQuestion, "password question?")
                .CheckProperty(x => x.Username, "username" + Guid.NewGuid())
                .VerifyTheMappings();
        }
    }
}
